package com.hzncc.flowable_diboot.mapper;

import com.diboot.core.mapper.BaseCrudMapper;
import com.hzncc.flowable_diboot.entity.ClueUser;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
* Clue - User 关联中间表 相关Mapper层接口定义
* @author MyName
* @version 1.0
* @date 2024-06-06
* Copyright © MyCorp
*/
@Mapper
public interface ClueUserMapper extends BaseCrudMapper<ClueUser> {
    @Insert("insert into mdl_clue_iam_user(clue,user) value(#{cid},#{uid})")
    void star(String uid,String cid);
    @Update("update mdl_clue_iam_user set is_deleted = 1 where user = #{uid} and clue in (${cids})")
    void del(String uid,String cids);
    @Select("select mc.id from mdl_clue mc left join mdl_clue_iam_user cu on mc.id = cu.clue where mc.is_deleted = 0 and cu.is_deleted = 0 and cu.user = #{uid}")
    List<String> selectStar(String uid);
}